<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        *{
            margin: 0px;padding: 0px;
        }
        #search{
            width:258px;
            height:40px;
            margin: 100px auto;
            /*background-color: pink;*/
        }
        #search input{
            background: url("img/left.jpg") no-repeat;text-indent: 20px;
            width:208px;            outline-style: none;
            height: 40px; color: #ccc;float: left;border:1px solid #cccccc;
        }
        #search button{
            height: 40px;
            width: 42px;
            background: url(img/right.jpg) no-repeat;
            float: left;border: 1px solid #cccccc;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div id="search">
        <input type="text" id="text" value="请输入.....">
        <button id="btn"></button>

    </div>
    <script type="text/javascript">
        var text = document.getElementById("text");
        text.onfocus = function () {
            if(text.value=="请输入....."){
                text.value = "";
                text.style.color = "#333";
            }
        }
        text.onblur = function () {
            if(text.value==""){
                text.value = "请输入.....";
                text.style.color = "#ccc";
            }
        }

    </script>

</body>
</html>